<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>水平居中t</title>
    <style>
         a{
             display: block;
             margin-left: auto;
             margin-right: auto;
             width: 800px;
             background-color: red;
         }     
    </style>
</head>
<body>
    <a href="#">a</a>
</body>
</html>